package com.Iron.Dao.Impl;


import com.Iron.Dao.UserDao;
import org.springframework.context.annotation.Lazy;
import org.springframework.context.annotation.Primary;
import org.springframework.context.annotation.Profile;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Repository;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

@Repository("userDao2")
@Primary
@Profile("test") //只有test环境才可以使用
public class UserDaoImpl2 implements UserDao {


    public UserDaoImpl2() {
        System.out.println("userDao2创建");
    }

    @PostConstruct
    public void init(){
        System.out.println("userDao2的初始化方法");
    }


    @PreDestroy
    public void destroy(){
        System.out.println("userDao2的销毁方法");
    }
}
